<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模板字符串</title>
</head>
<body>
    
</body>
<script>
    var name = "张三"
    var str = "哈哈哈\n你好";
    console.log(str);
    // 哈哈哈 张三 你好

    // 模板语法
    let a = 2;
    let b = 4;
    let con = `
    哈哈哈
    ${name}
    你好
    ${ a * b }
    `;
    console.log(con);

    // 使用场景
    let idcard;
    let json = `{name:"张三",age:18,idcard:${idcard}}`;

</script>
</html>